<template>
	<div class="enterpriseOne">
		<!-- 企业详情头部 -->
		<oneHeader :baseData="baseData"></oneHeader>
		<!-- 企业详情导航 -->
		<div class="enterpriseOne_navlist">
			<div class="enOne_navitem" :class="navOneNum===0 ? 'active' : ''" @click="toNavOne(0)">
				<img v-if="navOneNum==0" src="../../../public/images/enterprise/xinxi-on.png" class="xinxi" alt="">
				<img v-else src="../../../public/images/enterprise/xinxi-on.png" class="xinxi" alt="">
				<div class="navitemname" :class="navOneNum===0 ? 'active' : ''">
					基本信息
				</div>
			</div>
			<div class="enOne_navitem" :class="navOneNum===1 ? 'active' : ''" @click="toNavOne(1)">
				<img v-if="navOneNum==1" src="../../../public/images/enterprise/qiye-on.png" class="xinxi" alt="">
				<img v-else src="../../../public/images/enterprise/qiye-on.png" class="xinxi" alt="">
				<div class="navitemname" :class="navOneNum===1 ? 'active' : ''">
					企业画像
				</div>
				
			</div>
			<div class="enOne_navitem" :class="navOneNum===2 ? 'active' : ''" @click="toNavOne(2)">
				<img v-if="navOneNum==2" src="../../../public/images/enterprise/zhishi-on.png" class="xinxi" alt="">
				<img v-else src="../../../public/images/enterprise/zhishi-on.png" class="xinxi" alt="">
				<div class="navitemname" :class="navOneNum===2 ? 'active' : ''">
					知识产权
				</div>
				
			</div>
			<div class="enOne_navitem" :class="navOneNum===3 ? 'active' : ''" @click="toNavOne(3)">
				<img v-if="navOneNum==3" src="../../../public/images/enterprise/rongzi-on.png" class="xinxi" alt="">
				<img v-else src="../../../public/images/enterprise/rongzi-on.png" class="xinxi" alt="">
				<div class="navitemname" :class="navOneNum===3 ? 'active' : ''">
					融资历程
				</div>
				
			</div>
		</div>
		<!-- 企业详情导航对应页面 -->
		<div class="enterpriseOne_content">
			<!-- 基本信息页面 -->
			<basicInformation :bcompany="bCompany" v-if="navOneNum===0"  ></basicInformation>
			<!-- 企业画像页面 -->
			<enterpriseImage v-if="navOneNum===1"></enterpriseImage>
			<!-- 知识产权页面 -->
			<iProperty v-if="navOneNum===2"></iProperty>
			<!-- 融资历程页面 -->
			<financeCourse v-if="navOneNum===3"></financeCourse>
		</div>
	</div>
</template>

<script>
	import oneHeader from '../../components/enterprise/oneHeader.vue'
	import basicInformation from '../../components/enterprise/basicInformation.vue'
	import enterpriseImage from '../../components/enterprise/enterpriseImage.vue'
	import iProperty from '../../components/enterprise/iProperty.vue'
	import financeCourse from '../../components/enterprise/financeCourse.vue'
	export default{
		name:'enterpriseOne',
		data() {
			return{
				navOneNum:0,
				baseData:
					{
							"end_date": "",
							"describer": "",
							"issuance_date": "",
							"max": "",
							"reg_address": "",
							"regcapital_amt": 0,
							"is_list": "",
							"legal_rep": "",
							"business_scope": "",
							"homeurl": "",
							"uni_code": "",
							"update_time": "",
							"register_org": "",
							"field": "",
							"qualified_name": "",
							"phone": "",
							"company_name": "",
							"iconurl": "",
							"business_state": "",
							"found_date": "",
							"company_size": ""
					}
				,
				bCompany:''
			}
		},
		mounted() {
			this.bCompany=this.$route.query.comname
			this.getBasedata()
			this.$bus.$on('updateComname',async (comname)=>{
				this.bCompany=comname
				this.baseData={
							"end_date": "",
							"describer": "",
							"issuance_date": "",
							"max": "",
							"reg_address": "",
							"regcapital_amt": 0,
							"is_list": "",
							"legal_rep": "",
							"business_scope": "",
							"homeurl": "",
							"uni_code": "",
							"update_time": "",
							"register_org": "",
							"field": "",
							"qualified_name": "",
							"phone": "",
							"company_name": "",
							"iconurl": "",
							"business_state": "",
							"found_date": "",
							"company_size": ""
					}
				this.getBasedata()
			})
		},
		methods:{
			// 获取企业详情头部信息
			async getBasedata(){
				console.log(this.bCompany)
					var dt = {
						"params": {
							"normGuid": "b55cbf6d-df81-46fb-93d7-7678bd089471",
								"fieldList": [{
												"key":"company_name",
												"value":this.bCompany
										}]
						}
					};
					const aaa = await this.$api.post('dcockpit/rest/cockpitApi/searchListNormResult', dt)
					let {custom:{result}}={...aaa}
					this.baseData=result.cockpitData[0]
				
				
			},
			// 导航切换
			toNavOne(e){
				this.navOneNum=e
			}
		},
		components:{
			oneHeader,
			basicInformation,
			enterpriseImage,
			iProperty,
			financeCourse
		}
	}
</script>

<style lang="stylus" rel='stylesheet/stylus' scoped>
	@import "~@/assets/enterpriseOne.styl"
</style>
